#' Online filter
#'
#' @param a  filter factor
#' @param type type of filter
#'
#' @return a stateful function
#' @export
#'
new_filter <- function(a, type = c("highpass", "lowpass"))
{
  type <- match.arg(type)
  switch(type,
         highpass = mk_online_func_x("highpass", a),
         lowpass = mk_online_func_x("lowpass", a))
}
